// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;

module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const shopStaffgl = sequelizeClient.define('shop-staffgl', {
    subject: {      //类别
      type: DataTypes.STRING,
    },
    workername: {   //姓名
      type: DataTypes.STRING,
      allowNull: false //不允许为空
    },
    phonenumber: {  //手机号
      type: DataTypes.STRING,
      allowNull: false //不允许为空
    },
    VIPID: {        //关联会员ID
      type: DataTypes.STRING,
    },
    Afstore: {      //所属店铺
      type: DataTypes.STRING,
      allowNull: false //不允许为空
    },
    state: {        //状态
      type: DataTypes.STRING,
    },
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  shopStaffgl.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return shopStaffgl;
};
